<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // every some 

        let arr = [
            {
                flag: true,
                name: 'zs',
                age: '16'
            },
            {
                flag: true,
                name: 'ls',
                age: '19'
            },
            {
                flag: true,
                name: 'ww',
                age: '17'
            },
            {
                flag: true,
                name: 'zl',
                age: '18'
            },
            {
                flag: false,
                name: 'zz',
                age: '25'
            },
        ]

        // 判断是否全部成年
        let allAdults = arr.every((val, index) => val.age >= 18)
        console.log(allAdults)

        // 判断flag
        let checked = arr.every(val => val.flag)
        console.log(checked)

        //判断是否有名字
        let named = arr.every(val => val.name)
        console.log(named)

        //判断是否有未成年人
        let hasYoung = arr.some(val => val.age < 18)
        console.log(hasYoung)

        //判断是否有flag为否
        let ischecked = arr.some(val => !val.flag)
        console.log(ischecked)

        //判断是否有zs
        let findZS = arr.some(val => val.name === 'zs')
        console.log(findZS)
    </script>
</body>

</html>